﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MainMasterPage.Master" AutoEventWireup="true" CodeBehind="Period.aspx.cs" Inherits="OpenSIS.School.Period" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

<%@ Register Src="~/TimePicker.ascx" TagName="TimePicker" TagPrefix="TimePic" %>


<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
            <td>
            
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td class="page_heading_black">
                            <asp:Label CssClass="page_heading_black" ID="lblFoundCount" runat="server" meta:resourcekey="lblFoundCount"></asp:Label>
                        </td>
                        <td align="right">
                            <table border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td>
                                        <asp:ImageButton ID="ibtnAdd" CausesValidation="false" runat="server" ImageUrl="~/App_Themes/main/images/add.png" />
                                    </td>
                                    <td>
                                        <img src="../App_Themes/main/images/icon_separator.png" alt />
                                    </td>
                                    <td>
                                        <asp:ImageButton ID="imgBtnEdit" runat="server" ImageUrl="~/App_Themes/main/images/edit.png"
                                            OnClick="imgBtnEdit_Click" CausesValidation="false" />
                                    </td>
                                    <td>
                                        <img src="../App_Themes/main/images/icon_separator.png" />
                                    </td>
                                    <td>
                                        <asp:ImageButton ID="imgBtnDelete" runat="server" ImageUrl="~/App_Themes/main/images/delete.png"
                                            CausesValidation="false" OnClick="imgBtnDelete_Click" OnClientClick="if(!confirm('Are you sure ?')){return false;}" />
                                    </td>
                                    <td>
                                        <img src="../App_Themes/main/images/icon_separator.png" />
                                    </td>
                                    <td>
                                        <asp:ImageButton ID="ibtnDownLoadExcel" runat="server" ImageUrl="~/App_Themes/main/images/download_excel.png" />
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
                <div class="clear_m">
                </div>
                <table cellpadding="0" width="100%" border="0" cellspacing="0">
                    <tr>
                        <td>
                            <div class="ClsReorderListContainer">
                                
                                            <table width="100%" cellpadding="0" cellspacing="0" border="0">
                                                <tr>
                                                    <td class="grid_header_color">
                                                    <table width="100%" cellpadding="0" cellspacing="0">
                                                        <tr>
                                                            <td class="grid_header_left"></td>
                                                            <td class="grid_header">
                                                                <table width="100%" border="0" cellpadding="0" cellspacing="0">
                                                            <tr>
                                                                <td width="2%">
                                                                    <div style="width: 30px;">
                                                                    </div>
                                                                </td>
                                                                <td width="1%" class="padding_gen_small">
                                                                    <asp:CheckBox ID="chkrow" runat="server" onclick="javascript:SelectDeselectAllCheckboxes(this);" meta:resourcekey="chkrow"/>
                                                                </td>
                                                                <td width="25%" class="grid_header_txt" align="left">
                                                                    <asp:Literal ID="ML_0008" runat="server" meta:resourcekey="ML_0008">Title</asp:Literal>
                                                                </td>
                                                                <td width="15%" class="grid_header_txt">
                                                                    <asp:Literal ID="ML_0009" runat="server" meta:resourcekey="ML_0009">Short Name</asp:Literal>
                                                                </td>
                                                                <td width="11%" class="grid_header_txt">
                                                                    <asp:Literal ID="ML_0010" runat="server" meta:resourcekey="ML_0010">Start Time</asp:Literal>
                                                                </td>
                                                                <td width="11%" class="grid_header_txt">
                                                                    <asp:Literal ID="ML_0011" runat="server" meta:resourcekey="ML_0011">End Time</asp:Literal>
                                                                </td>
                                                                <td width="11%" class="grid_header_txt">
                                                                    <asp:Literal ID="ML_0012" runat="server" meta:resourcekey="ML_0012">Length</asp:Literal>
                                                                </td>
                                                                <td width="7%" class="grid_header_txt">
                                                                    <asp:Literal ID="ML_0013" runat="server" meta:resourcekey="ML_0013">Block</asp:Literal>
                                                                </td>
                                                                <td width="17%" class="grid_header_txt" align="center">
                                                                    <asp:Literal ID="ML_0014" runat="server" meta:resourcekey="ML_0014">Used For Attendance</asp:Literal>
                                                                </td>
                                                            </tr>
                                                        </table>
                                                            </td>
                                                            <td class="grid_header_right"></td>                                                
                                                        </tr>
                                                    </table>
                                                    </td>
                                                </tr>
                                            </table>
                                            <table width="100%" border="0" cellpadding="0" cellspacing="0" align="center">
                                    <tr>
                                        <td align="left" class="blue_content2">
                                            <cc1:ReorderList ID="rlperiod" runat="server" AutoGenerateColumns="false" Width="100%"
                                                ItemInsertLocation="Beginning" EnableViewState="true" CallbackCssStyle="ClsCallBackStyle"
                                                HeaderStyle-CssClass="grid_header" RowStyle-CssClass="grid_row" AlternatingRowStyle-CssClass="grid_altrow"
                                                BorderWidth="0" CellPadding="0" CellSpacing="0" DataKeyField="sch_period_id"
                                                SortOrderField="Priority" OnItemReorder="rlperiod_ItemReorder" DragHandleAlignment="Left"
                                                OnItemDataBound="rlperiod_ItemDataBound" PostBackOnReorder="true">
                                                <draghandletemplate>
                                                        <div class="ClsDragHandle"></div>
                                                </draghandletemplate>
                                                <ItemTemplate>
                                                    <div class="grid_bg">
                                                        <table width="100%" cellpadding="0" cellspacing="0" border="0">
                                                            <tr>
                                                                <td width="3%" align="left" class="padding_gen_small grid_b_border">
                                                                    <asp:CheckBox ID="chkrow" runat="server"/> 
                                                                </td>
                                                                <td width="25%" class="padding_gen_small grid_b_border">
                                                                    <asp:Label ID="lblTitle" runat="server" Text='<%#Eval("title")%>'></asp:Label>
                                                                </td>
                                                                <td width="15%" align="left" class="padding_gen_small grid_b_border">
                                                                    <asp:Label ID="lblShortName" runat="server" Text='<%#Eval("short_name")%>'></asp:Label>
                                                                </td>
                                                                <td width="11%" align="left" class="padding_gen_small grid_b_border">
                                                                    <asp:Label ID="lblStartTime" runat="server" Text='<%#Eval("start_time")%>'></asp:Label>
                                                                </td>
                                                                <td width="11%" align="left" class="padding_gen_small grid_b_border">
                                                                    <asp:Label ID="lblEndTime" runat="server" Text='<%#Eval("end_time")%>'></asp:Label>
                                                                </td>
                                                                <td width="11%" align="left" class="padding_gen_small grid_b_border">
                                                                    <asp:Label ID="lblLength" runat="server" Text='<%#Eval("length")%>'></asp:Label>
                                                                </td>
                                                                <td width="7%" align="left" class="padding_gen_small grid_b_border">
                                                                    <asp:Label ID="lblBlock" runat="server" Text='<%#Eval("block")%>'></asp:Label>
                                                                </td>
                                                                <td width="17%" align="center" class="padding_gen_small grid_b_border">
                                                                    <asp:HiddenField ID="hdnPeriodId" runat="server" Value='<%#Eval("sch_period_id") %>' />
                                                                    <asp:HiddenField ID="hdnUFA" runat="server" Value='<%#Eval("use_atted")%>' />
                                                                    <asp:CheckBox ID="UsedForAttendance" runat="server" meta:resourcekey="UsedForAttendance"/>
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </div>
                                                </ItemTemplate>
                                                <ReorderTemplate>
                                                    <asp:Panel ID="Panel2" runat="server" CssClass="ClsReorderCue">
                                                    </asp:Panel>
                                                </ReorderTemplate>
                                                <EmptyListTemplate>
                                                    <table width="100%" cellpadding="0" cellspacing="0" border="0">
                                                        <tr align="center">
                                                            <td align="center" class="ClsReorderCue grid_bg" >

                                                                <span class="blue_large"><asp:Literal ID="ML_0027" runat="server" meta:resourcekey="ML_0027">No Data Found</asp:Literal></span>

                                                            </td>
                                                        </tr>
                                                    </table>
                                                </EmptyListTemplate>
                                            </cc1:ReorderList>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <div id="calendar">
                            </div>
                            <asp:Panel ID="panel_Popup" runat="server" CssClass="ModalPopup" Style="display: none;"
                                Width="630" Height="315">
                               <table width="100%" cellpadding="0" cellspacing="0">
                    <tr>
                        <td class="modal_header_left bottom_black">&nbsp;</td>
                        <td class="modal_header_bg" valign="top"><div class="modal_header"><asp:Literal ID="ML_0029" runat="server" meta:resourcekey="ML_0029">Add Period</asp:Literal></div></td>
                    </tr>
                    <tr>
                        <td class="modal_rtgrey">&nbsp;</td>
                        <td class="modal_bg"> 
                                    <div style="overflow: auto; overflow-x: hidden; width: 565px; height: 207px;">
                                        <table border="0" cellspacing="0" cellpadding="4" width="100%">
                                            <tr>
                                                <td>
                                                    <table>
                                                        <tr>
                                                            <td class="school_lcontent">
                                                                <asp:Literal ID="ML_0030" runat="server" meta:resourcekey="ML_0030">Title</asp:Literal>
                                                            </td>
                                                            <td class="colon">
                                                                <asp:Literal ID="ML_0031" runat="server" meta:resourcekey="ML_0031">:</asp:Literal>
                                                            </td>
                                                            <td class="width40">
                                                                <asp:TextBox CssClass="textbox1" ID="txtTitle" runat="server" meta:resourcekey="txtTitle"></asp:TextBox>
                                                            </td>
                                                            <td><asp:RequiredFieldValidator ID="RFTitle" runat="server" ControlToValidate="txtTitle" ValidationGroup="AddPeriod" ErrorMessage="<div class='alert' align='left'>Title is Required</div>" Display="Dynamic" meta:resourcekey="RFTitle"></asp:RequiredFieldValidator></td>
                                                         </tr>
                                                         <tr>
                                                            <td>
                                                                <asp:Literal ID="ML_0034" runat="server" meta:resourcekey="ML_0034">Short Name</asp:Literal>
                                                            </td>
                                                            <td class="colon">
                                                                <asp:Literal ID="ML_0035" runat="server" meta:resourcekey="ML_0035">:</asp:Literal>
                                                            </td>
                                                            <td>
                                                                <asp:TextBox CssClass="textbox1" ID="txtShortName" runat="server" meta:resourcekey="txtShortName"></asp:TextBox>
                                                            </td>
                                                            <td></td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                                <asp:Literal ID="ML_0037" runat="server" meta:resourcekey="ML_0037">Start Time</asp:Literal>
                                                            </td>
                                                            <td class="colon">
                                                                <asp:Literal ID="ML_0038" runat="server" meta:resourcekey="ML_0038">:</asp:Literal>
                                                            </td>
                                                            <td>
                                                                <TimePic:TimePicker ID="txtStartTime" runat="server" meta:resourcekey="txtStartTime"/>
                                                            </td>
                                                            <td></td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                                <asp:Literal ID="ML_0040" runat="server" meta:resourcekey="ML_0040">End Time</asp:Literal>
                                                            </td>
                                                            <td class="colon">
                                                                <asp:Literal ID="ML_0041" runat="server" meta:resourcekey="ML_0041">:</asp:Literal>
                                                            </td>
                                                            <td>
                                                                <TimePic:TimePicker ID="txtEndTime" runat="server" meta:resourcekey="txtEndTime"/>
                                                            </td>
                                                            <td></td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                                <asp:Literal ID="ML_0043" runat="server" meta:resourcekey="ML_0043">Length(Minutes)</asp:Literal>
                                                            </td>
                                                            <td class="colon">
                                                                <asp:Literal ID="ML_0044" runat="server" meta:resourcekey="ML_0044">:</asp:Literal>
                                                            </td>
                                                            <td>
                                                                <asp:TextBox CssClass="textbox1" onclick="setTimePicker('A');" ID="txtLength" runat="server" meta:resourcekey="txtLength"></asp:TextBox>
                                                            </td>
                                                            <td><asp:CompareValidator ID="CVlength" runat="server" Operator="GreaterThanEqual" ValueToCompare="0" Type="Integer" ErrorMessage="<div class='alert' align='left'>Integer Value is Required</div>" Display="Dynamic" ValidationGroup="AddPeriod" ControlToValidate="txtLength" meta:resourcekey="CVlength"></asp:CompareValidator></td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                                <asp:Literal ID="ML_0047" runat="server" meta:resourcekey="ML_0047">Block</asp:Literal>
                                                            </td>
                                                            <td class="colon">
                                                                <asp:Literal ID="ML_0048" runat="server" meta:resourcekey="ML_0048">:</asp:Literal>
                                                            </td>
                                                            <td>
                                                                <asp:TextBox CssClass="textbox1" ID="txtBlock" runat="server" meta:resourcekey="txtBlock"></asp:TextBox>
                                                            </td>
                                                            <td></td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                                <asp:Literal ID="ML_0050" runat="server" meta:resourcekey="ML_0050">Used for Attendance</asp:Literal>
                                                            </td>
                                                            <td class="colon">
                                                                <asp:Literal ID="ML_0051" runat="server" meta:resourcekey="ML_0051">:</asp:Literal>
                                                            </td>
                                                            <td>
                                                                <asp:CheckBox ID="ChkUsedAttendance" runat="server" meta:resourcekey="ChkUsedAttendance"/>
                                                            </td>
                                                            <td></td>
                                                        </tr>
                                                    </table>
                                                </td>
                                            </tr>
                                        </table>
                                    </div>
                                    <div class="separator_hor">
                                    </div>
                                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                        <tr>
                                            <td align="right">
                                                <asp:Button ID="btnSave" runat="server" Text="Save" OnClick="btnSave_Click" ValidationGroup="AddPeriod"
                                                    CssClass="modalbtn_active" meta:resourcekey="btnSave"/>
                                                <asp:Button ID="btnCancel" CausesValidation="false" OnClick="btnCancel_Click" runat="server"
                                                    Text="Cancel" CssClass="modalbtn_active" meta:resourcekey="btnCancel" OnClientClick="hidePopup('ctl00_ContentPlaceHolder1_ModalPopupExtender1')"/>
                                            </td>
                                        </tr>
                                    </table>
                             </td></tr></table>
                            </asp:Panel>
                            <cc1:ModalPopupExtender ID="ModalPopupExtender1" runat="server" BackgroundCssClass="Inactive"
                                TargetControlID="ibtnAdd" PopupControlID="panel_Popup" />
                            <asp:Panel ID="panelEdit" runat="server" Style="display: none;" CssClass="ModalPopup"
                                Width="630" Height="315">
                                <table width="100%" cellpadding="0" cellspacing="0">
                    <tr>
                        <td class="modal_header_left bottom_black">&nbsp;</td>
                        <td class="modal_header_bg" valign="top"><div class="modal_header"><asp:Literal ID="ML_0057" runat="server" meta:resourcekey="ML_0057">Edit Period</asp:Literal></div></td>
                    </tr>
                    <tr>
                        <td class="modal_rtgrey">&nbsp;</td>
                        <td class="modal_bg"> 
                                    <div style="overflow: auto; overflow-x: hidden; width: 550px; height: 207px;">
                                        <table border="0" cellspacing="0" cellpadding="4" width="100%">
                                            <tr>
                                                <td>
                                                    <table>
                                                        <tr>
                                                            <td class="school_lcontent" >
                                                                <asp:Literal ID="ML_0058" runat="server" meta:resourcekey="ML_0058">Title</asp:Literal>
                                                            </td>
                                                            <td class="colon">
                                                                <asp:Literal ID="ML_0059" runat="server" meta:resourcekey="ML_0059">:</asp:Literal>
                                                            </td>
                                                            <td class="width45">
                                                                <asp:TextBox CssClass="textbox1" ID="txtTitleEdit" runat="server" meta:resourcekey="txtTitleEdit"></asp:TextBox>
                                                            </td>
                                                            <td><asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtTitleEdit" ValidationGroup="EditPeriod" ErrorMessage="<div class='alert' align='left'>Title is Required</div>" Display="Dynamic" meta:resourcekey="RequiredFieldValidator1"></asp:RequiredFieldValidator></td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                                <asp:Literal ID="ML_0062" runat="server" meta:resourcekey="ML_0062">Short Name</asp:Literal>
                                                            </td>
                                                            <td class="colon">
                                                                <asp:Literal ID="ML_0063" runat="server" meta:resourcekey="ML_0063">:</asp:Literal>
                                                            </td>
                                                            <td>
                                                                <asp:TextBox CssClass="textbox1" ID="txtShortNameEdit" runat="server" meta:resourcekey="txtShortNameEdit"></asp:TextBox>
                                                            </td>
                                                            <td></td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                                <asp:Literal ID="ML_0065" runat="server" meta:resourcekey="ML_0065">Start Time</asp:Literal>
                                                            </td>
                                                            <td class="colon">
                                                                <asp:Literal ID="ML_0066" runat="server" meta:resourcekey="ML_0066">:</asp:Literal>
                                                            </td>
                                                            <td>  
                                                                    <TimePic:TimePicker ID="txtStartTimeEdit" runat="server" meta:resourcekey="txtStartTimeEdit"/>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                                <asp:Literal ID="ML_0068" runat="server" meta:resourcekey="ML_0068">End Time</asp:Literal>
                                                            </td>
                                                            <td class="colon">
                                                                <asp:Literal ID="ML_0069" runat="server" meta:resourcekey="ML_0069">:</asp:Literal>
                                                            </td>
                                                            <td>  
                                                                    <TimePic:TimePicker ID="txtEndTimeEdit" runat="server" meta:resourcekey="txtEndTimeEdit"/>
                                                            </td>
                                                            <td></td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                                <asp:Literal ID="ML_0071" runat="server" meta:resourcekey="ML_0071">Length(Minutes)</asp:Literal>
                                                            </td>
                                                            <td class="colon">
                                                                <asp:Literal ID="ML_0072" runat="server" meta:resourcekey="ML_0072">:</asp:Literal>
                                                            </td>
                                                            <td>
                                                                <asp:TextBox CssClass="textbox1" onclick="setTimePicker('E');" ID="txtLengthEdit" runat="server" meta:resourcekey="txtLengthEdit"></asp:TextBox>
                                                                <asp:CompareValidator ID="CompareValidator1" runat="server" Operator="GreaterThanEqual"
                                                                    ValueToCompare="0" Type="Integer" ErrorMessage="<div style='color:red;'>Integer Value is Required</div>"
                                                                    Display="Dynamic" ValidationGroup="EditPeriod" ControlToValidate="txtLengthEdit" meta:resourcekey="CompareValidator1"></asp:CompareValidator>
                                                            </td>
                                                            <td></td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                                <asp:Literal ID="ML_0075" runat="server" meta:resourcekey="ML_0075">Block</asp:Literal>
                                                            </td>
                                                            <td class="colon">
                                                                <asp:Literal ID="ML_0076" runat="server" meta:resourcekey="ML_0076">:</asp:Literal>
                                                            </td>
                                                            <td>
                                                                <asp:TextBox CssClass="textbox1" ID="txtBlockEdit" runat="server" meta:resourcekey="txtBlockEdit"></asp:TextBox>
                                                            </td>
                                                            <td></td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                                <asp:Literal ID="ML_0078" runat="server" meta:resourcekey="ML_0078">Used for Attendance</asp:Literal>
                                                            </td>
                                                            <td class="colon">
                                                                <asp:Literal ID="ML_0079" runat="server" meta:resourcekey="ML_0079">:</asp:Literal>
                                                            </td>
                                                            <td>
                                                                <asp:CheckBox ID="ChkUsedAttenEdit" runat="server" meta:resourcekey="ChkUsedAttenEdit"/>
                                                            </td>
                                                            <td></td>
                                                        </tr>
                                                    </table>
                                                </td>
                                            </tr>
                                        </table>
                                    </div>
                                    <div class="separator_hor">
                                    </div>
                                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                        <tr>
                                            <td align="right">
                                                <asp:Button ID="btnUpdate" runat="server" OnClick="btnUpdate_Click" Text="Update"
                                                    CssClass="modalbtn_active" ValidationGroup="EditPeriod" meta:resourcekey="btnUpdate"/>
                                                <asp:Button ID="btnCancelEdit" OnClick="btnCancelEdit_Click" CausesValidation="false"
                                                    runat="server" Text="Cancel" CssClass="modalbtn_active" meta:resourcekey="btnCancelEdit" OnClientClick="hidePopup('ctl00_ContentPlaceHolder1_ModalPopupExtender2')"/>
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                                            </tr>
                                        </table>
                            </asp:Panel>
                            <cc1:ModalPopupExtender ID="ModalPopupExtender2" runat="server" BackgroundCssClass="Inactive"
                                TargetControlID="imgBtnEdit" PopupControlID="panelEdit" Enabled="false" />
                        </td>
                    </tr>
                </table>
            </td>
            
        </tr>
    </table>

</asp:Content>
